﻿using System;
using System.Collections.Generic;
using System.Text;

namespace Obsidian.Action
{
    public class ResultRelation
    {

        private string _result;
        private string _field;
        private string _relationField;
        private string _aimingResult;
        private string _aimingField;
        private ResultRelationType _type = ResultRelationType.Single;

        public ResultRelation(string field, string relationField, string aimingResult, string aimingField, ResultRelationType type)
        {
            if (String.IsNullOrEmpty(field))
                throw new Exception("参数field不能为空");
            if (String.IsNullOrEmpty(relationField))
                throw new Exception("参数relationField不能为空");
            if (String.IsNullOrEmpty(aimingResult))
                throw new Exception("参数aimingResult不能为空");
            if (String.IsNullOrEmpty(aimingField))
                throw new Exception("参数aimingField不能为空");
            this._field = field;
            this._relationField = relationField;
            this._aimingResult = aimingResult;
            this._aimingField = aimingField;
            this._type = type;
        }


        public string Field
        {
            get { return this._field; }
        }

        public string RelationField
        {
            get { return this._relationField; }
        }

        public string AimingResult
        {
            get { return this._aimingResult; }
        }

        public string AimingField
        {
            get { return this._aimingField; }
        }

        public ResultRelationType Type
        {
            get { return this._type; }
        }

    }

    public enum ResultRelationType
    {
        Single,
        Multiple
    }
}
